package design_patterns.factoryPetter;

import design_patterns.factoryPetter.entity.Circle;
import design_patterns.factoryPetter.entity.Rectangle;
import design_patterns.factoryPetter.entity.Square;

public class ShapeFactory {
	
	public Shape getShape(String shapeType){
		if(shapeType==null){
			return null;
		}
		
		if(shapeType.equals("长方形")){
			return new Rectangle();
		}
		
		if(shapeType.equals("正方形")){
			return new Square();
		}
		
		if(shapeType.equals("圆形")){
			return new Circle();
		}
		return null;
	}
}
